package com.liuya.safe.policy.service;

import com.liuya.base.BaseService;
import com.liuya.common.exception.EntityExistException;
import com.liuya.db.script.BusinessData;
import com.liuya.safe.model.SafeUser;
import com.liuya.entitle.BusinessDataTestResult;
import com.liuya.safe.model.SafeBusinessData;

import java.util.Collection;
import java.util.Map;

public interface BusinessDataManagerService extends BaseService<SafeBusinessData> {

    public void installBusinessData(String fileUrl, boolean overwrite);

    public Collection checkSameNameBusinessData(String fileUrl);

    public SafeBusinessData getBusinessData(String id);

    public Collection getLikelyBusinessData(String name);

    public SafeBusinessData addBusinessData(String pid, String name, String description, boolean isLeaf) throws EntityExistException;

    public void updateBusinessData(String id, String name, String description) throws EntityExistException;

    public void updateBusinessData(String id, com.liuya.db.sql.xml.BusinessData content) throws EntityExistException;

    public void deleteBusinessData(String id);

    public Collection getAllBusinessData();

    public SafeBusinessData getBusinessDataTree();

    public void moveBusinessData(String id, String newPid);

    public SafeBusinessData copyBusinessData(String sourceId, String newName, String newDescription) throws EntityExistException;

    public BusinessDataTestResult testBusinessData(BusinessData scriptBusinessData, SafeUser user, Map context);
}
